package net.loyintean.pearlshell.validation;

import net.loyintean.pearlshell.validation.config.ValidConfig;

public interface IValidRuleConfig {

	final IValidRuleConfig OBJ_NOT_NULL = new ValidConfig("OBJ_NOT_NULL");

	final IValidRuleConfig STRING_ALL_CHINESE = new ValidConfig(
			"STRING_ALL_CHINESE");

	final IValidRuleConfig STRING_IS_FLOAT = new ValidConfig("STRING_IS_FLOAT");

	final IValidRuleConfig STRING_IS_DOUBLE = new ValidConfig(
			"STRING_IS_DOUBLE");

	final IValidRuleConfig STRING_IS_INT = new ValidConfig("STRING_IS_INT");

	final IValidRuleConfig STRING_IS_LONG = new ValidConfig("STRING_IS_LONG");

	/** whether the string is longer than max length.
	 * <p>
	 * the eg of how to use this rule, @see
	 * {@link net.loyintean.pearlshell.validation.rule.StringMaxLengthTest} */
	final IValidRuleConfig STRING_MAX_LENGTH = new ValidConfig(
			"STRING_MAX_LENGTH");

	final IValidRuleConfig STRING_MIN_LENGTH = new ValidConfig(
			"STRING_MIN_LENGTH");

	final IValidRuleConfig STRING_NOT_BLANK = new ValidConfig(
			"STRING_NOT_BLANK");

	final IValidRuleConfig STRING_WITHOUT_CHINESE = new ValidConfig(
			"STRING_WITHOUT_CHINESE");

	// 2014-7-9 from林俊 to辰明 blank line tart
	// CLOSE blank line is better in format
	// 2014-7-9 from林俊 to辰明 blank line end
	final IValidRuleConfig STRING_IS_PHONENUM = new ValidConfig(
			"STRING_PHONE_NUM");

	// 2014-7-9 from林俊 to辰明 comment the rule start
	// DONE use javadoc to explain what the valid rule is. as there might be
	// serial rules for identify card, it's neccessary to tell user the rule
	// exactly.
	// 2014-7-9 from林俊 to辰明 comment the rule end
	final IValidRuleConfig STRING_IS_IDNUM = new ValidConfig(
			"STRING_IDENTIFY_CARD");

	/** config to valid whether the string is email.<br>
	 * email校验所需的配置。
	 * <p>
	 * the toValid Object must be String. need no other input parameters. <br>
	 * 被校验对象必须是字符串。不需要额外的入参。
	 * 
	 * @see {@link net.loyintean.pearlshell.validation.rule.StringIsEmailValidRuleImpl} */
	final IValidRuleConfig STRING_IS_EMAIL = new ValidConfig("STRING_IS_EMAIL");

	/** STRING_MATCH_REGEX:字符串匹配正则表达式的校验规则
	 * <p>
	 * 也就是自定义正则表达式校验。<br>
	 * 要求附加校验参数。<br>
	 * 
	 * @see {@link net.loyintean.pearlshell.validation.rule.StringMatchRegexValidRuleImpl#isValidParamIllegal(IValidRuleConfig)} */
	final IValidRuleConfig STRING_MATCH_REGEX = new ValidConfig(
			"STRING_MATCH_REGEX");

	/** DATE_FORMAT_FULL :字符串符合全日期格式
	 * <p>
	 * 即符合“yyyy-MM-dd HH:mm:ss”的格式 */
	final IValidRuleConfig DATE_FORMAT_FULL = new ValidConfig(
			"DATE_FORMAT_FULL", new Object[] { "yyyy-MM-dd HH:mm:ss" });

	/** DATE_FORMAT_FULL :字符串符合短日期格式
	 * <p>
	 * 即符合“yyyy-MM-dd”的格式 */
	final IValidRuleConfig DATE_FORMAT_SHORT = new ValidConfig(
			"DATE_FORMAT_SHORT", new Object[] { "yyyy-MM-dd" });

	/** DATE_FORMAT :字符串是否符合日期格式。
	 * <p>
	 * 日期格式需要自己指定 */
	final IValidRuleConfig DATE_FORMAT = new ValidConfig("DATE_FORMAT");

	String ruleName();

	Object[] validParam();
}
